<?php


namespace app\admin\validate;

class Component extends Base
{
    protected $rule =   [
        'id'  => 'require',
        'component_type'  => 'require',
        'drawing_no'  => 'require',
        'drawing_name'  => 'require',
        'number'  => 'require',
        'material'   => 'require',
        'weight' => 'require',
        'colour' => 'require',
        'processes_type' => 'require',
        'drawing_img' => 'require',
        'component_status' => 'require',
    ];

    protected $message  =   [
        'id.require' => 'id必须',
        'component_type.require' => '部件类型必须',
        'drawing_no.require' => '图号必须',
        'drawing_name.require' => '图名必须',
        'number.require' => '数量必须',
        'material.require' => '材料必须',
        'weight.require' => '重量必须',
        'colour.require' => '颜色必须',
        'processes_type.require' => '工序类型必须',
        'drawing_img.require' => '图纸图片必须',
        'component_status.require' => '部件状态必须',
    ];


    protected $scene = [
        'insert'  =>  ['component_type','drawing_no','drawing_name','number','material','weight','colour','processes_type','drawing_img','component_status'],
        'update'  =>  ['id','component_type','drawing_no','drawing_name','number','material','weight','colour','processes_type','drawing_img','component_status'],
        'detail'  =>  ['id'],
        'status'  =>  ['ids', 'status'],
        'del'  =>  ['ids'],
        'clean'  =>  ['ids'],
    ];
}